package com.codeZ.StrategyPattern.strategy;

import com.codeZ.StrategyPattern.normal.Receipt;
import lombok.Setter;

/**
 * 策略接口 上下文
 *
 * @author codeZhang
 * @Date 2024/8/28 09:30
 */
@Setter
public class ReceiptStrategyContext {

    private ReceiptHandleStrategy receiptHandleStrategy;

    //调用策略类中的方法
    public void handleReceipt(Receipt receipt){
        if(receipt != null){
            receiptHandleStrategy.handleReceipt(receipt);
        }
    }

}
